/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import javax.swing.JOptionPane;

import cytoscape.view.CytoscapeDesktop;



/*******************************************************************************
 * Class GUIException writes the errors to cytoscape.
 * @author liat
 * Last updater: Liat
 * Date 20.08.09
 ******************************************************************************/
public class GUIException extends Exception{

    
		private static CytoscapeDesktop _desktop;
    	/**
    	 * Display the error message to cytoscape using JOptionPane.
    	 * @param errStr the error message.
    	 */
        public static void displayErrorMessage(String errStr) {
             JOptionPane.showMessageDialog(_desktop, errStr, "Error", JOptionPane.ERROR_MESSAGE);
        }
        
		/**
		* Save cytoscape desktop to display error messages.
		*/
        public static void setDesktop(CytoscapeDesktop desktop) {
        	_desktop = desktop;
        }
}
